﻿
GO
/****** Object:  Table [dbo].[Menu]    Script Date: 09/25/2015 16:00:44 ******/
SET IDENTITY_INSERT [dbo].[Menu] ON
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (1, N'机构管理', N'100', N'', 1, 1, 3, NULL)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (2, N'机构管控', N'101', N'/api/branch/branchlist,/api/branch/addbranch,/api/branch/frozenstatus,', 1, 1, 1, 1)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (3, N'机构配置', N'102', N'/api/branch/detailbranch,/api/branch/editbranch,/api/branch/adddeduction,/api/branch/editdeduction,/api/branch/addinvoicesubject,/api/branch/editinvoicesubject,', 1, 2, 2, 1)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (5, N'帐号管理', N'200', N'', 1, 2, 3, NULL)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (6, N'帐号管控', N'201', N'/api/user/accountadd,/api/user/accountupdate,/api/user/accountenabled,/api/user/getlist,/api/user/getmodel,/api/user/getorgcombox,/api/user/setauthorityaccount,/api/user/getmenubyloginuser,/api/user/accountcancellation,/api/user/getaccountauthority,/api/user/accountset,/api/user/changepassword,/api/user/accountsetingdetail,', 1, 1, 7, 5)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (7, N'专线管理', N'300', N'', 1, 3, 2, NULL)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (8, N'专线管控', N'301', N'/api/special/speciallist,/api/special/createspecial,/api/special/cancelspecial,/api/special/detailspecial,/api/special/basicspecial,/api/special/editspecial,', 1, 1, 2, 7)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (9, N'合同管控', N'302', N'', 1, 2, 2, 7)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (10, N'专线合同', N'30201', N'/api/special/speciallist,/api/special/specialcontractlist,/api/special/renewalcontract,', 1, 1, 2, 9)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (11, N'供应商合同', N'30202', N'/api/special/speciallist,/api/special/sellersupplierspecialcontractlist,/api/special/abandonedcontract,/api/special/addcontract,', 1, 2, 2, 9)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (12, N'销售商合同', N'30203', N'/api/special/speciallist,/api/special/sellersupplierspecialcontractlist,/api/special/abandonedcontract,/api/special/addcontract,', 1, 3, 2, 9)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (14, N'发票管理', N'400', N'', 1, 4, 4, NULL)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (15, N'开票管控', N'401', N'/api/invoice/auditinvoices,/api/invoice/getmodel,/api/invoice/getlist,', 1, 1, 2, 14)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (16, N'收票管控', N'402', N'/api/collectinvoice/collectinvoicelist,/api/collectinvoice/collectinvoicedetail,/api/collectinvoice/examinecollectinvoice,/api/collectinvoice/abandonedcollectinvoice,', 1, 2, 2, 14)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (17, N'资金管理', N'500', N'', 1, 5, 2, NULL)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (18, N'收款管控', N'501', N'/api/gathering/auditgathering,/api/gathering/getmodel,/api/gathering/getlist,', 1, 1, 2, 17)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (19, N'付款管控', N'502', N'/api/payment/managelist,/api/payment/confirm,/api/payment/abandoned,/api/payment/updateprintviewnum,/api/payment/printdetail,/api/payment/detail,', 1, 2, 2, 17)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (20, N'扣款管理', N'600', N'', 1, 6, 2, NULL)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (21, N'扣款管控', N'601', N'', 1, 1, 2, 20)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (22, N'保险管理', N'700', N'', 1, 7, 2, NULL)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (23, N'保险对账', N'701', N'', 1, 1, 3, 22)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (24, N'基本信息', N'303', N'/api/special/basicspecial,', 1, 3, 4, 7)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (25, N'申请发票', N'403', N'/api/invoice/applyinvoice,/api/invoice/getinvoicesubject,/api/invoice/getsellersupplier,/api/invoice/getmodel,/api/invoice/getlist,', 1, 3, 4, 14)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (27, N'收款信息', N'503', N'/api/gathering/submitgathering,/api/gathering/getmodel,/api/gathering/getlist,', 1, 3, 4, 17)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (29, N'付款信息', N'504', N'/api/payment/applylist,/api/payment/apply,/api/payment/detail,/api/payment/applybeforeget,/api/payment/applybeforevalidatedebts,', 1, 4, 4, 17)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (30, N'提交发票', N'404', N'/api/collectinvoice/collectinvoicelist,/api/collectinvoice/invoicesubmit,/api/collectinvoice/collectinvoicedetail,', 1, 4, 4, 14)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (31, N'扣款信息', N'602', N'', 1, 2, 4, 20)
INSERT [dbo].[Menu] ([ID], [Name], [Code], [Url], [Status], [Sort], [UserMenu], [UpMenuId]) VALUES (32, N'购买保险', N'702', N'', 1, 2, 4, 22)
SET IDENTITY_INSERT [dbo].[Menu] OFF
go
alter table [user] alter column [Login] nvarchar(20) collate chinese_prc_cs_as	--区分大小写 用户 登录名称
alter table [Special] alter column [Name] nvarchar(50) collate chinese_prc_cs_as	--区分大小写 专线 名称
alter table [Branch] alter column [Name] nvarchar(50) collate chinese_prc_cs_as	--区分大小写 机构 名称
--alter table [user] alter column [Login] nvarchar(20) collate chinese_prc_ci_as	--不区分大小写
alter table [SellerSupplier] alter column [Name] nvarchar(50) collate chinese_prc_cs_as	--区分大小写 供应商/销售商 名称
go
SET IDENTITY_INSERT [dbo].[User] ON
INSERT INTO [dbo].[User]([ID],[Login],[PassWord],[Name],[IsSpecialManager],[Type],[Status],[Phone])
     VALUES(1,'admin','14e1b600b1fd579f47433b88e8d85291','管理员',0,0,1,'13541231245')
SET IDENTITY_INSERT [dbo].[User] OFF
GO

SET IDENTITY_INSERT [dbo].[Branch] ON
INSERT INTO [dbo].[Branch]
           ([ID],[Name],[Type],[Status],[GrossMargin],[CounterFeeRate],[ArrearsTotal],[OweTicketsDay],[CreaterId],[CreateTime],[UpdaterId],[UpdaterName],[UpdateTime])
     VALUES(1,'总公司',1,1,0,0,0,0,1,'2015-9-21',1,'管理员','2015-9-21')
SET IDENTITY_INSERT [dbo].[Branch] OFF
GO
--总公司账号
SET IDENTITY_INSERT [dbo].[User] ON
insert into [User] (ID,Login,PassWord,Name,IsSpecialManager,Type,Status,Phone,BranchId,CreaterId,CreateTime,UpdaterId,UpdateTime)
             VALUES (2,'test','14e1b600b1fd579f47433b88e8d85291','总公司',0,1,1,'',1,1,NULL,1,NULL)
SET IDENTITY_INSERT [dbo].[User] OFF
--总公司权限
insert into Relation_User_Menu ( UserId, MenuId)
select 2,ID from Menu where UserMenu&1=1
go
select * from [user]
select * from Branch
select * from Relation_User_Menu